function [ userinfo ] = setUser_cluster( userNum  )
global MBSnum PBSnum FBSnum mR pR fR MBSinfo PBSinfo FBSinfo BSnum
user=0;
for i=BSnum:-1:1
    
    if      i>(MBSnum+PBSnum)
             x0=FBSinfo(i-MBSnum-PBSnum,1); 
             y0=FBSinfo(i-MBSnum-PBSnum,2);
             u=ceil(1 + (3-1).*rand(1)); % user number per cluster is 2:1:5
             rU=0.95*fR*sqrt(rand(1,u));
             seta=2*pi*rand(1,u); 
             xU=x0+rU.*cos(seta); 
             userinfo(user+1:user+u,1)=xU;
             yU=y0+rU.*sin(seta);
             userinfo(user+1:user+u,2)=yU;
             userinfo(user+1:user+u,3)=ceil(-11+(-9+10).*rand(u,1));
             user=user+u;
    else
        if MBSnum<i<=(PBSnum+MBSnum)&&(i~=1)
             x0=PBSinfo(i-MBSnum,1); 
             y0=PBSinfo(i-MBSnum,2);
             u=ceil(3 + (6-3).*rand(1)); % user number per cluster is 2:1:5
             rU=0.95*pR*sqrt(rand(1,u));
             seta=2*pi*rand(1,u); 
             xU=x0+rU.*cos(seta); 
             userinfo(user+1:user+u,1)=xU;
             yU=y0+rU.*sin(seta);
             userinfo(user+1:user+u,2)=yU;
             userinfo(user+1:user+u,3)=ceil(-11+(-9+10).*rand(u,1));
             user=user+u;
        else
             
             x0=MBSinfo(i,1); 
             y0=MBSinfo(i,2);
             rU=0.98*mR*sqrt(rand(1,userNum-user));
             setaU=2*pi*rand(1,userNum-user); 
             xU=x0+rU.*cos(setaU); 
             yU=y0+rU.*sin(setaU);
             userinfo(user+1:userNum,1)=xU;
             userinfo(user+1:userNum,2)=yU;
             userinfo(user+1:userNum,3)=ceil(-11+(-9+10).*rand(userNum-user,1));
    end
             
end
end
end

